<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="util.CookieUtil"%>

<%Cookie[] cookies = request.getCookies();   
String loginId ="";
String checkValue = "";
String checked = "";
String cookieName = GlbFinal.SESSION_NAME;
   Cookie cookie = null;   
     if (cookies != null && cookies.length > 0) {   
         for (int i = 0; i < cookies.length; i++) {   
             cookie = cookies[i];   
            if (cookie.getName().equals(cookieName)) {   
               break;   
            }   
         }  
     }
      if (cookie != null) {   
    	  loginId = URLDecoder.decode(cookie.getValue(),"UTF-8");
    	  System.out.print(loginId);
    	  checkValue= "1";
    	  checked = "checked";
        }     
          %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@page import="net.comm.common.GlbFinal"%>
<%@page import="java.net.URLDecoder"%><html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>i友邻</title>
	<link rel="stylesheet" type="text/css" href="${cpath}/css/index.css" />
	<!--[if IE 6]>
	  <script type="text/javascript" src="${cpath}/jspng/DD_belatedPNG_0.0.8a-min.js"></script>
	  <script type="text/javascript" src="${cpath}/jspng/ie6-png.js"></script>
	<![endif]-->
</head>
 <script type="text/javascript">   
	var browser=navigator.appName   
	var b_version=navigator.appVersion   
	var version=b_version.split(";");   
	var trim_Version=version[1].replace(/[ ]/g,"");   
	if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0")   
	{   
	}   
    else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE9.0")   
	{   
		alert("当前浏览器是IE 9.0，请按F12键选择IE7或IE8兼容模式浏览网站");   
	}   
</script>  

<body onload="javascript:document.getElementById('loginfield').focus();">
<div align="center">
  <div class="head"><div class="logo"><img src="${cpath}/images/logo.png" /></div><div class="by"><img src="${cpath}/images/banner1.png"  width="325" height="35" /></div></div>
  
<form id="loginform" name="loginform" method="post" action="${cpath}/login">
  <div class="content">
    <div class="login">
	  <div class="logintr1"><img src="${cpath}/icon/user_suit.gif"/><input name="loginfield" id="loginfield" type="text" size="15" value="<%=loginId %>"></div>
	  <div class="logintr1"> <img src="${cpath}/icon/lock.gif" /><input name="password" type="password" size="15"   onkeydown="if(event.keyCode==13)  javascript:dologin();"></div>
	  <div class="logintr3"><input name="loginsts" type="checkbox" value="<%=checkValue %>" <%=checked %> >记住用户名</div>
	  <div class="loginbt"><img src="${cpath}/images/loginbt.gif" onclick="javascript:dologin();"/></div>
	  <div class="logintr5"><!----> <a href="${cpath}/user/register.jsp">注册帐号</a> ｜<a href="${cpath}/getpasswd.jsp">忘记密码</a> <!-- ｜ <a href="${cpath}/shenqing_faq/1_1.html">首席客服</a> --></div>
	</div>
	<div class="ad1"></div>
  </div>
	<!--隐藏字段--->
	<INPUT type="hidden" name="email">
	<INPUT type="hidden" name="nick">
	<INPUT type="hidden" name="nexturl" value="/users.do?action=main">
</form>  
  <div class="foot">奥福瑞出品  粤ICP备11006344
</div>
</div>
</body>
</html>
	<SCRIPT language=javascript>
		function dologin()
		{
				var re = /^[_a-zA-Z0-9\-\.]+@([\-_a-zA-Z0-9]+\.)+[a-zA-Z0-9]{2,3}$/;
				var form = document.loginform;
				var loginfield		= form['loginfield'];
				var password	= form['password'];

				var email	= form['email'];
				var nick	= form['nick'];

				if(loginfield.value == "")
				{
					alert("请输入用户名");
					loginfield.select();
					return false;
				}
				if(loginfield.value.match(re)){
					email.value = loginfield.value;			
				}else{
					nick.value = loginfield.value;				
				}

				if (password.value == "")
				{
					alert("密码不可为空");
					password.select();
					return false;
				}
				form.submit();
		}
	</SCRIPT>